package com.new2i.dao.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.new2i.dao.able.ScreenQuarterDao;
import com.new2i.dao.mapper.ScreenQuarterMapper; 
import com.new2i.model.ScreenQuarterEntity; 

/**
 * 筛查医生数据库访问的实现类
 * 
 * @since 2015/09/22
 * @author 2i
 *
 */
@Repository("ScreenQuarterDao")
public class ScreenQuarterDaoImpl implements ScreenQuarterDao {

	@Autowired
	private ScreenQuarterMapper ScreenQuarterMapper;

	@Override
	public List<HashMap<String, Object>> selectScreenQuarterList(Integer doctor_id, Integer page) {
		if(page == null || page <= 0) 
			page = 1;
		Integer limit = 10; 
		Integer start = (page - 1) * limit;
		return ScreenQuarterMapper.selectScreenQuarterList(doctor_id,start,limit);
	}

	@Override
	public ScreenQuarterEntity insertScreenQuarter(ScreenQuarterEntity scQuarter) {
		ScreenQuarterMapper.insertScreenQuarter(scQuarter);
		return scQuarter;
	}

	@Override
	public HashMap<String, Object> getScreenQuarterById(Integer sc_quarter_id) { 
		return ScreenQuarterMapper.getScreenQuarterById(sc_quarter_id);
	}

	@Override
	public Integer updateScreenQuarter(ScreenQuarterEntity scQuarter) {
		return ScreenQuarterMapper.updateScreenQuarter(scQuarter);
	}
 
	@Override
	public Integer removeScreenQuarter(Integer sc_quarter_id,Integer doctor_id) {
		return ScreenQuarterMapper.removeScreenQuarter(sc_quarter_id,doctor_id); 
	} 
	
	@Override
	public Integer backupScreenQuarter(Integer sc_quarter_id,Integer doctor_id) {
		return ScreenQuarterMapper.backupScreenQuarter(sc_quarter_id, doctor_id);
	} 
	
	@Override
	public Integer deleteScreenQuarter(Integer sc_quarter_id,Integer doctor_id) {
		return ScreenQuarterMapper.deleteScreenQuarter(sc_quarter_id,doctor_id); 
	} 

}
